.\" @(#)PAPI_flops    0.10 00/05/18 CHD; from S5
.TH PAPI_flips 3 "September, 2004" "PAPI Programmer's Reference" "PAPI"
.SH NAME
.nf
  PAPI_flips \- PAPI High level: Simplified call to get Mflips/s, real and processor time
  PAPI_flops \- PAPI High level: Simplified call to get Mflops/s, real and processor time
.fi

.SH SYNOPSIS
.B C Interface
.nf
.B #include <papi.h>
.BI "int PAPI_flips (float *" rtime ", float *" ptime ", long_long *" flpins ", float *" mflips ");"
.BI "int PAPI_flops (float *" rtime ", float *" ptime ", long_long *" flpops ", float *" mflops ");"
.fi
.B Fortran Interface
.nf
.B #include "fpapi.h"
.BI PAPIF_flips(C_FLOAT\  real_time,\  C_FLOAT\  proc_time,\  C_LONG_LONG\  flpins,\  C_FLOAT\  mflips,\  C_INT\  check )
.BI PAPIF_flops(C_FLOAT\  real_time,\  C_FLOAT\  proc_time,\  C_LONG_LONG\  flpops,\  C_FLOAT\  mflops,\  C_INT\  check )
.fi

.SH DESCRIPTION
.LP
The first call to
.B PAPI_flips(\|) "or" PAPI_flops(\|)
will initialize the PAPI High Level interface, set up the counters
to monitor PAPI_FP_INS or PAPI_FP_OPS and PAPI_TOT_CYC events and start the counters.
Subsequent calls will read the counters and return total real time,
total process time, total floating point instructions or operations since the start
of the measurement and the Mflip/s or Mflop/s rate since latest call to
.B PAPI_flips(\|) "or" PAPI_flops(\|).                
A call to
.B PAPI_stop_counters(\|) "
will stop the counters from running and then calls such as
.B PAPI_start_counters(\|) "
can safely be used.

.SH ARGUMENTS
.I *rtime 
-- total realtime since the first PAPI_flops() call
.LP
.I *ptime 
-- total process time since the first PAPI_flops() call
.LP
.I *flpins, flpops 
-- total floating point instructions or operations since the first call
.LP
.I *mflips, *mflops 
-- Mflip/s or Mflop/s achieved since the previous call

.SH RETURN VALUES
On success, this function returns
.B "PAPI_OK."
 On error, a non-zero error code is returned. 

.SH ERRORS
 In addition to the possible errors returned by the various PAPI
low level calls, the following errors could also be returned:
.TP
.B "PAPI_EINVAL"
The counters were already started by something other than:
.B PAPI_flips(\|) "or" PAPI_flops(\|).                
.TP
.B "PAPI_ENOEVNT"
The floating point operations,floating point instruction or
total cycles event does not exist.
.TP
.B "PAPI_ENOMEM"
Insufficient memory to complete the operation.


.SH NOTES
.LP
Mflip/s, or millions of floating point instructions per second, is defined 
in this context as the number of instructions issued to the floating point 
unit per second. It is usually calculated directly from a counter measurement 
and may be different from platform to platform.
Mflop/s, or millions of floating point operations per second, is intended to 
represent the number of floating point arithmetic operations per second.
Attempts are made to massage the counter values to produce the theoreticallly
expected value by, for instance, doubling FMA counts or subtracting floating point
loads and stores if necessary.
.I CAVEAT EMPTOR

.LP
.nf
.BR  PAPI_flops() and PAPI_flips() " may be called by:"
.B  \t
.B  \tthe user application program
.fi
.LP
.nf
.B  \t
.BR  PAPI_flops() " contains calls to:"
.B  \t
.B  \tPAPI_perror()
.B  \tPAPI_library_init()
.B  \tPAPI_get_hardware_info()
.B  \tPAPI_create_eventset()
.B  \tPAPI_add_event()
.B  \tPAPI_start()
.B  \tPAPI_get_real_usec()
.B  \tPAPI_accum()
.B  \tPAPI_shutdown()
.fi

.SH BUGS
These functions have no known bugs.

.SH SEE ALSO
.BR "PAPI_stop_counters (3)", "PAPI_ipc (3)", "PAPI_set_opt (3)"
